import { lazy } from "react";
import { createBrowserRouter } from "react-router-dom";

import { LazyComponent } from "@/components/Lazy";

import { Layout } from "../layout";

export const constantRoutes = [
  {
    path: "/login",
    element: <LazyComponent component={lazy(() => import("@/views/login"))} />,
  },
  {
    path: "/",
    element: <Layout />,
    children: [
      {
        path: "/404",
        element: <LazyComponent component={lazy(() => import("@/views/error/404"))} />,
        meta: { hidden: true },
      },
    ],
  },
];

const router = createBrowserRouter(constantRoutes);

export default router;
